package com.eui.demo.demowizard
{
	import com.eui.demo.demowizard.step.FirstStepPM;
	import com.eui.demo.demowizard.step.FirstStepView;
	import com.eui.demo.demowizard.step.LastStepPM;
	import com.eui.demo.demowizard.step.LastStepView;
	import com.eui.demo.demowizard.step.SecondStepPM;
	import com.eui.demo.demowizard.step.SecondStepView;
	import com.eui.arch.application.model.NodePM;
	import com.eui.arch.util.PMContext;
	import com.eui.arch.wizard.model.WizardPM;

	import flash.utils.getQualifiedClassName;

	import mx.rpc.IResponder;

	[Bindable]
	public class DemoWizardPM extends WizardPM
	{
		public static const MANAGED_PM_ID:String=getQualifiedClassName(DemoWizardPM);

		public static function getInstance():DemoWizardPM
		{
			return PMContext.getInstance().getPM(MANAGED_PM_ID) as DemoWizardPM;
		}

		public function DemoWizardPM()
		{
			super();
		}

		override public function pmId():String
		{
			return MANAGED_PM_ID;
		}

		override protected function initSteps():void
		{
			addStep("first", FirstStepPM, FirstStepView, true, false, true);
			addStep("second", SecondStepPM, SecondStepView, true, true, true);
			addStep("last", LastStepPM, LastStepView, true, true, false);
		}

		override public function loadWizardData(data:Object, responder:IResponder):void
		{
			if (data && data.name)
			{
				backName=data.name;
				name=data.name;
			}
			responder.result(null);
		}

		public var name:String;
		public var backName:String;
	}
}